#set pond parameters

	#must declare dimensions!
	pond=array(dim=c(22,6))	

	#column name #column number #description
	p.name=1 #name of pond
	p.area=2 #area (ft^2)
	p.bottom=3 #bottom elev above MSL (ft)
	p.surf=4 #initial head (ft)
	p.min.surf=5 #min head (ft)
	p.max.surf=6 #max head (ft)
	
	pond[1, ]=c(name='Ox1',      area=1029059,  bottom=1.97, surf=2,min.surf=0,max.surf=10)
	pond[2, ]=c(name='Ox2',      area=776105,   bottom=1.31, surf=2,min.surf=0,max.surf=10)
	pond[3, ]=c(name='Ox3',      area=161244,   bottom=0.66, surf=2,min.surf=0,max.surf=10)
	pond[4, ]=c(name='TM1',      area=79807,    bottom=0,    surf=2,min.surf=0,max.surf=10)
	pond[5, ]=c(name='TM2',      area=80111,    bottom=0,    surf=2,min.surf=0,max.surf=10)
	pond[6, ]=c(name='TM3',      area=53560,    bottom=0,    surf=2,min.surf=0,max.surf=10)
	pond[7, ]=c(name='Pilot',    area=65212,    bottom=0,    surf=2,min.surf=0,max.surf=10) 
	pond[8, ]=c(name='Chlorine', area=4169,     bottom=1.25, surf=2,min.surf=0,max.surf=10)
	pond[9, ]=c(name='Allen',    area=471875,   bottom=0,    surf=2,min.surf=0,max.surf=10) 
	pond[10,]=c(name='Gearheart',area=322845,   bottom=-.625,surf=2,min.surf=0,max.surf=10)
	pond[11,]=c(name='Hauser',   area=425062,   bottom=-1.88,surf=2,min.surf=0,max.surf=10)
	pond[12,]=c(name='Brackish', area=569500,   bottom=1,    surf=2,min.surf=0,max.surf=10)
	pond[13,]=c(name='Bay',      area=10^10,    bottom=0,    surf=2,min.surf=0,max.surf=10)
	pond[14,]=c(name='M-Box',    area=1000,     bottom=0,    surf=2,min.surf=0,max.surf=10)
	pond[15,]=c(name='Ox2 Box',  area=1000,     bottom=0,    surf=2,min.surf=0,max.surf=10)
	pond[16,]=c(name='Ox3 Box',  area=1000,     bottom=0,    surf=2,min.surf=0,max.surf=10)
	pond[17,]=c(name='Box 21',   area=1000,     bottom=0,    surf=2,min.surf=0,max.surf=7.2)
	pond[18,]=c(name='Box 22',   area=1000,     bottom=0,    surf=2,min.surf=0,max.surf=7.78)
	pond[19,]=c(name='Box 23',   area=1000,     bottom=0,    surf=2,min.surf=0,max.surf=7.7)
	pond[20,]=c(name='Box 24',   area=1000,     bottom=0,    surf=2,min.surf=0,max.surf=7.61)
	pond[21,]=c(name='Box 25',   area=1000,     bottom=0,    surf=2,min.surf=0,max.surf=7.26)
	pond[22,]=c(name='Box 26',   area=1000,     bottom=0,    surf=2,min.surf=0,max.surf=7.15)
	

#set box parameters
	
	#must declare dimensions!
	box=array(dim=c(45,17))
	
	#column name #column number #description
	box.name=1 #name of unit
	box.type=2 #1=weir/sluice box #2=pump
	box.upstream=3 #upstream pond
	box.downstream=4 #downstream pond
	box.crest=5 #elevation of weir crest
	box.top=6 #elevation of box top;
	box.width=7 #width of weir crest
	box.roughness=8 #empirical roughness factor (1=min, 0=max)
	box.pump=9 #pumping rate
	box.l.up=10 #upstream pipe length
	box.d.up=11 #downstream pipe length
	box.f.up=12 #upstream pipe friction factor
	box.l.dn=13 #upstream pipe diameter
	box.d.dn=14 #downstream pipe diameter
	box.f.dn=15 #downstream pipe friction factor
	box.gate.up=16 #percent opening of gated pipe (upstream)
	box.gate.dn=17 #percent opening of gated pipe (downstream)
	
	
	box[1,]=c(	name='Ox1 to Ox2',
			type=1,
			upstream=1,
			downstream=2,
			crest=4.93,
			top=7.95,
			width=4,
			roughness=1,
			pump=0,
			l.up=0,
			d.up=2,
			f.up=0,
			l.dn=20,
			d.dn=2,
			f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[2,]=c(      name='Ox1 to Ox2',
                        type=1,
                        upstream=1,
                        downstream=2,
                        crest=5.38,
                        top=7.82,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[3,]=c(      name='Ox1 to TM1',
                        type=1,
                        upstream=1,
                        downstream=4,
                        crest=5.27,
                        top=7.65,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[4,]=c(      name='Ox1 to TM1',
                        type=1,
                        upstream=1,
                        downstream=4,
                        crest=5.22,
                        top=7.61,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[5,]=c(      name='Ox2 to TM2',
                        type=1,
                        upstream=1,
                        downstream=5,
                        crest=5.22,
                        top=7.02,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[6,]=c(      name='Ox2 to TM2',
                        type=1,
                        upstream=1,
                        downstream=5,
                        crest=6.74,
                        top=7.01,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[7,]=c(      name='Ox2 to Ox3',
                        type=1,
                        upstream=1,
                        downstream=3,
                        crest=0,
                        top=7.04,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[8,]=c(      name='Ox2 to Ox3',
                        type=1,
                        upstream=1,
                        downstream=3,
                        crest=0,
                        top=7.07,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[9,]=c(      name='TM1 to Box20',
                        type=1,
                        upstream=4,
                        downstream=14,
                        crest=0,
                        top=2.8,
                        width=10,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[10,]=c(     name='TM2 to Box20',
                        type=1,
                        upstream=5,
                        downstream=14,
                        crest=2.68,
                        top=3.75,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
			gate.up=1,
			gate.dn=1)

        box[11,]=c(     name='TM2 to Box20',
                        type=1,
                        upstream=5,
                        downstream=14,
                        crest=2.71,
                        top=3.65,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[12,]=c(     name='TM2 to Box20',
                        type=1,
                        upstream=5,
                        downstream=14,
                        crest=2.70,
                        top=3.88,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[13,]=c(     name='TM2 to Box20',
                        type=1,
                        upstream=5,
                        downstream=14,
                        crest=2.66,
                        top=3.94,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[14,]=c(     name='TM3 to Box20',
                        type=1,
                        upstream=6,
                        downstream=14,
                        crest=2.67,
                        top=3.94,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[15,]=c(     name='TM3 to Box20',
                        type=1,
                        upstream=6,
                        downstream=14,
                        crest=2.64,
                        top=4.16,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[16,]=c(     name='TM3 to Box20',
                        type=1,
                        upstream=6,
                        downstream=14,
                        crest=2.69,
                        top=4.27,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[17,]=c(     name='TM3 to Box20',
                        type=1,
                        upstream=6,
                        downstream=14,
                        crest=2.69,
                        top=4.46,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[18,]=c(     name='Ox3 to TM3',
                        type=1,
                        upstream=3,
                        downstream=6,
                        crest=5.25,
                        top=6.94,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[19,]=c(     name='Ox3 to Ox3-Box',
                        type=1,
                        upstream=3,
                        downstream=16,
                        crest=0,
                        top=7.74,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[20,]=c(     name='Ox2-Box to Pilot',
                        type=3,
                        upstream=15,
                        downstream=7,
                        crest=0,
                        top=10,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[21,]=c(     name='Cl to Box21 (V-notch)',
                        type=1,
                        upstream=8,
                        downstream=17,
                        crest=0,
                        top=11.5,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=100,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[22,]=c(     name='Box21 to Box22',
                        type=1,
                        upstream=17,
                        downstream=18,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=100,
                        d.up=2,
                        f.up=0,
                        l.dn=100,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[23,]=c(      name='Box22 to Box23',
                        type=1,
                        upstream=18,
                        downstream=19,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=100,
                        d.up=2,
                        f.up=0,
                        l.dn=100,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[24,]=c(     name='Box23 to Box24',
                        type=1,
                        upstream=19,
                        downstream=20,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=100,
                        d.up=2,
                        f.up=0,
                        l.dn=100,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[25,]=c(     name='Box24 to Box25',
                        type=1,
                        upstream=20,
                        downstream=21,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=100,
                        d.up=2,
                        f.up=0,
                        l.dn=100,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[26,]=c(     name='Box21 to Allen',
                        type=1,
                        upstream=17,
                        downstream=9,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[27,]=c(     name='Box22 to Allen',
                        type=1,
                        upstream=18,
                        downstream=9,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[28,]=c(     name='Box23 to Allen',
                        type=1,
                        upstream=19,
                        downstream=9,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[29,]=c(     name='Box24 to Allen',
                        type=1,
                        upstream=20,
                        downstream=9,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[30,]=c(     name='Box25 to Allen',
                        type=1,
                        upstream=21,
                        downstream=9,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[31,]=c(     name='Box21 to Box26',
                        type=1,
                        upstream=17,
                        downstream=22,
                        crest=0,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=100,
                        d.up=2,
                        f.up=0,
                        l.dn=100,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[32,]=c(     name='Box26 to Hauser',
                        type=2,
                        upstream=22,
                        downstream=11,
                        crest=10,
                        top=10,
                        width=2,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=100,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[33,]=c(     name='Allen to Gearht',
                        type=1,
                        upstream=9,
                        downstream=10,
                        crest=0,
                        top=7.04,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[34,]=c(     name='Allen to Gearht',
                        type=1,
                        upstream=9,
                        downstream=10,
                        crest=0,
                        top=6.95,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[35,]=c(     name='Allen to Gearht',
                        type=1,
                        upstream=9,
                        downstream=10,
                        crest=0,
                        top=6.67,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[36,]=c(     name='Gearht to Hauser',
                        type=1,
                        upstream=10,
                        downstream=11,
                        crest=0,
                        top=6.74,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[37,]=c(     name='Gearht to Hauser',
                        type=1,
                        upstream=10,
                        downstream=11,
                        crest=0,
                        top=7.02,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[38,]=c(     name='Hauser to Brackish',
                        type=1,
                        upstream=11,
                        downstream=12,
                        crest=0,
                        top=10,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=100,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[39,]=c(     name='Pump: Ox2 to Ox2-Box',
                        type=2,
                        upstream=2,
                        downstream=15,
                        crest=0,
                        top=0,
                        width=0,
                        roughness=1,
                        pump=1.67, #1.67mgd
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=0,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[40,]=c(     name='Pump: Ox3-Box to Chlorine',
                        type=2,
                        upstream=16,
                        downstream=8,
                        crest=0,
                        top=0,
                        width=0,
                        roughness=1,
                        pump=2, #2/4mgd
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=0,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[41,]=c(     name='Pump: Ox3 to Chlorine',
                        type=2,
                        upstream=3,
                        downstream=8,
                        crest=0,
                        top=0,
                        width=0,
                        roughness=1,
                        pump=0, #1.5/2.4mgd
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=0,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[42,]=c(     name='Pump: Ox3 to Chlorine',
                        type=2,
                        upstream=3,
                        downstream=8,
                        crest=0,
                        top=0,
                        width=0,
                        roughness=1,
                        pump=0, #4.2/5.8mgd
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=0,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[43,]=c(     name='Pump: M-Box to Chlorine',
                        type=2,
                        upstream=14,
                        downstream=8,
                        crest=0,
                        top=0,
                        width=0,
                        roughness=1,
                        pump=1.2, #1.2/2.3/2.9mgd
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=0,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[44,]=c(     name='Pump: Hauser to Chlorine',
                        type=2,
                        upstream=11,
                        downstream=8,
                        crest=0,
                        top=0,
                        width=0,
                        roughness=1,
                        pump=0, #1.5/3/4.5 mgd
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=20,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)

        box[45,]=c(     name='Chlorine to Bay',
                        type=1,
                        upstream=8,
                        downstream=13,
                        crest=0,
                        top=11.5,
                        width=4,
                        roughness=1,
                        pump=0,
                        l.up=0,
                        d.up=2,
                        f.up=0,
                        l.dn=100,
                        d.dn=2,
                        f.dn=0,
                        gate.up=1,
                        gate.dn=1)
